import request from '../../../components/Request';

export async function listRole(orgId, name) {
  let result = await request.post({ url: './role/listRole.do', data: { orgId: orgId, name: name } });
  return result.data;
}

export async function listModuleTree() {
  let result = await request.post({ url: './role/listModuleTree.do' });
  return result.data;
}

export async function saveRole(data) {
  let result = await request.post({ url: './role/saveRole.do', data: data });
  return result.data;
}

export async function deleteRole(roleId) {
  let result = await request.post({ url: './role/deleteRole.do', data: { roleId: roleId } });
  return result.data;
}

export async function updateRoleModule(data) {
  let result = await request.post({ url: './role/updateRoleModule.do', data: data });
  return result.data;
}

export async function listRoleModule(roleId) {
  let result = await request.post({ url: './role/listRoleModule.do', data: { roleId: roleId } });
  return result.data;
}
